package com.ruoyi.flow.flow.identity.activiti.enums;

import java.util.Objects;

/**
 * @author wtian
 * @version 1.0
 * @since 2018/9/5 13:02
 */
public enum Gender {
    FEMALE(2, "女"),
    MALE(1, "男");

    private int gender;
    private String cname;

    Gender(int gender, String cname) {
        this.gender = gender;
        this.cname = cname;
    }

    public int getGender() {
        return gender;
    }

    public String getCname() {
        return cname;
    }

    public static Gender fromValue(int value) {
        for (Gender gd : Gender.values()) {
            if (Objects.equals(gd.getGender(), value)) {
                return gd;
            }
        }
        return null;
    }
}
